home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Inne / Gry / Carnage_Contest / scripts / CC Original / tools / Cage.lua < prev    next >
Text File  |  2009-09-18  |  1KB  |  39 lines

  1. --------------------------------------------------------------------------------
  2. -- Weapon Cage
  3. -- Original Carnage Contest Weapon
  4. -- Script by DC, September 2009, www.UnrealSoftware.de
  5. --------------------------------------------------------------------------------
  6.  
  7. -- Setup Tables
  8. if cc==nil then cc={} end
  9. cc.cage={}
  10.  
  11. -- Load & Prepare Ressources
  12. cc.cage.gfx_wpn=loadgfx("buildings/cage.bmp")                        -- Weapon Image
  13. setmidhandle(cc.cage.gfx_wpn)
  14. cc.cage.sfx_build=loadsfx("buildmetal.ogg")                            -- Build Sound
  15.  
  16. --------------------------------------------------------------------------------
  17. -- Weapon: Cage
  18. --------------------------------------------------------------------------------
  19.  
  20. cc.cage.id=addweapon("cc.cage","Cage",cc.cage.gfx_wpn,0)            -- Add Weapon (0 uses)
  21.  
  22. function cc.cage.draw()                                                -- Draw
  23.     -- HUD Positioning
  24.     if weapon_shots==0 then
  25.         hudpositioning(pos_build,cc.cage.gfx_wpn,100,0,1)
  26.     end
  27. end
  28.  
  29. function cc.cage.attack(attack)                                        -- Attack
  30.     if (weapon_shots<=0) and (weapon_position==1) then
  31.         -- Use weapon and allow to use another one afterwards (1)
  32.         useweapon(1)
  33.         weapon_shots=weapon_shots+1
  34.         -- Draw
  35.         terrainimage(cc.cage.gfx_wpn,weapon_x,weapon_y)
  36.         -- Sound
  37.         playsound(cc.cage.sfx_build)
  38.     end
  39. end